package main

import (
	"github.com/xuxusheng/crawler/engine"
	"github.com/xuxusheng/crawler/zhenai/parser"
	"github.com/xuxusheng/crawler/scheduler"
	"github.com/xuxusheng/crawler/persist"
)

func main() {
	/*	engine.SimpleEngine{}.Run(engine.Request{
			Url:        "http://www.zhenai.com/zhenghun",
			ParserFunc: parser.ParseCityList,
		})*/

	/*	e := engine.ConcurrentEngine{
			Scheduler:   &scheduler.SimpleScheduler{},
			WorkerCount: 10,
		}*/

	e := engine.ConcurrentEngine{
		Scheduler:   &scheduler.QueuedScheduler{},
		ItemChan:    persist.ItemSaver(),
		WorkerCount: 10,
	}

	e.Run(engine.Request{
		Url:        "http://www.zhenai.com/zhenghun",
		ParserFunc: parser.ParseCityList,
	})
}
